//
//  UILabel+Extension.swift
//  Weibo
//
//  Created by 伍银荣 on 2021/12/16.
//  Copyright © 2021 com.WYR. All rights reserved.
//

import UIKit

extension UILabel {
    //可以在初始化的时候设置默认值
    convenience init(title: String, titleColor: UIColor = UIColor.darkGray, fontSize: CGFloat = 14) {
        self.init()
        text = title
        textColor = titleColor
        font = UIFont.systemFont(ofSize: fontSize)
        numberOfLines = 0
        textAlignment = NSTextAlignment.center
       //参数后面的值就是参数的默认值,如果不传递,就是用默认值
    }
}
